<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>慧题通-主页</title>
</head>
<body>
<el-menu
        id="menu"
        default-active="0"
        class="el-menu-vertical-demo"
        style="width: 135px;float: left"
>
    <el-menu-item index="0">
        <i class="el-icon-help"></i>
        <span slot="title">主页</span>
    </el-menu-item>
    <el-menu-item index="1" @click="toMyQuestion">
        <i class="el-icon-location"></i>
        <span slot="title">我的题目</span>
    </el-menu-item>
    <el-menu-item index="2" @click="toAllQuestion">
        <i class="el-icon-menu"></i>
        <span slot="title">全站题目</span>
    </el-menu-item>
    <el-menu-item index="3" @click="toDoQuestion">
        <i class="el-icon-setting"></i>
        <span slot="title">练习题目</span>
    </el-menu-item>
    <el-menu-item index="4" @click="toAddQuestion">
        <i class="el-icon-document"></i>
        <span slot="title">添加题目</span>
    </el-menu-item>
</el-menu>

<div id="app" v-loading="loading">
    <div style="display: flex;">
        <!--走马灯-->
        <template>
            <el-carousel indicator-position="outside"
                         class="my-carousel"
                         style="height: 60vh;width: 40vw">
                <el-carousel-item v-for="image in images">
                    <el-image
                            style="width: 100%; height: 100%"
                            :src="image">
                        <div slot="error" class="image-slot">
                            <i class="el-icon-picture-outline"></i>
                        </div>
                    </el-image>
                </el-carousel-item>
            </el-carousel>
        </template>

        <el-col style="height: fit-content;width: fit-content">
            <el-card
                    shadow="hover"
                    style="margin-left: 15px;height: 25vh;width: 25vh"
                    @click.native="toNoteManage">
                笔记管理
            </el-card>
            <!--<el-card
                    shadow="hover"
                    style="margin-left: 15px;height: 25vh;width: 25vh">
                xx管理
            </el-card>-->
        </el-col>

        <el-col style="height: fit-content;width: fit-content">
            <el-card
                    shadow="hover"
                    style="margin-left: 15px;height: 25vh;width: 25vh"
                    @click.native="toCategoryManage">
                分类管理
            </el-card>
            <!--<el-card
                    shadow="hover"
                    style="margin-left: 15px;height: 25vh;width: 25vh">
                xx管理
            </el-card>-->
        </el-col>

        <el-col style="height: fit-content;width: fit-content">
            <el-card
                    shadow="hover"
                    style="margin-left: 15px;height: 25vh;width: 25vh"
                    @click.native="toMe">
                个人中心
            </el-card>
            <!--<el-card
                    shadow="hover"
                    style="margin-left: 15px;height: 25vh;width: 25vh">
                xx管理
            </el-card>-->
        </el-col>

        <el-dropdown style="margin-left: 15px;height: 100%">
            <el-button>
                {{userInfo.nickname}}<i class="el-icon-arrow-down el-icon--right"></i>
            </el-button>
            <el-dropdown-menu slot="dropdown" v-if="userInfo.id != null">
                <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
            </el-dropdown-menu>
            <el-dropdown-menu slot="dropdown" v-if="userInfo.id === null">
                <el-dropdown-item @click.native="login">登录</el-dropdown-item>
            </el-dropdown-menu>
        </el-dropdown>
    </div>
</div>

</body>

<script src="../../js/vue.js"></script>
<script src="../../js/axios-0.18.0.js"></script>
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script src="../../plugins/element-ui/lib/index.js"></script>
<link rel="stylesheet" href="../../plugins/element-ui/lib/theme-chalk/index.css">

<link rel="stylesheet" href="../../css/main.css">

<script src="../../js/common.js"></script>
<script src="../../js/menu.js"></script>
<script src="../../js/main.js"></script>

</html>